import { http } from "@/utils/http.js";
export const updatePhone = (data) => {
  return http.request({
    method: "POST",
    url: "/user/updatePhone",
    data: data,
  });
};

// 手机号验证
export const checkPhone = (data) => {
  return http.request({
    method: "POST",
    url: "/user/checkPhone",
    data: data,
  });
};

// 退出登录
export const userout = (data) => {
  return http.request({
    method: "POST",
    url: "/user/out",
    data: data,
  });
};

//修改用户信息

export const userupdate = (data) => {
  return http.request({
    method: "POST",
    url: "/user/update",
    data: data,
  });
};

export const editReferrer = (data) => {
  return http.request({
    method: "POST",
    url: "/user/editReferrer",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const setPayPasswordApi = (data) => {
  return http.request({
    method: "POST",
    url: "/user/setPayPassword",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const resetPasswordByFormerApi = (data) => {
  return http.request({
    method: "POST",
    url: "/user/resetPasswordByFormer",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};

export const resetPasswordBySmsCodeApi = (data) => {
  return http.request({
    method: "POST",
    url: "/user/resetPasswordBySmsCode",
    data: {
      ...data,
      offLoading: true, // 加参数关闭api请求全局加载中提示
    },
  });
};
